<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/5/21
  Time: 20:26
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<c:set var="path" value="${pageContext.request.contextPath}"></c:set>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=0">

    <title>订单详情</title>

    <link href="${path}/AmazeUI-2.4.2/assets/css/admin.css" rel="stylesheet" type="text/css">
    <link href="${path}/AmazeUI-2.4.2/assets/css/amazeui.css" rel="stylesheet" type="text/css">

    <link href="${path}/css/personal.css" rel="stylesheet" type="text/css">
    <link href="${path}/css/orstyle.css" rel="stylesheet" type="text/css">
    <!-- layui的js -->
    <script src="${path}/layuiadmin/layui/layui.js" charset="utf-8"></script>
    <!-- layui使用的样式-->
    <link rel="stylesheet" href="${path}/layuiadmin/layui/css/layui.css" media="all">
    <script src="${path}/AmazeUI-2.4.2/assets/js/jquery.min.js"></script>
    <script src="${path}/AmazeUI-2.4.2/assets/js/amazeui.js"></script>


</head>

<body>
<article>
    <div class="mt-logo">
        <!--头 -->
        <header>
            <jsp:include page="header.jsp"></jsp:include>
        </header>
    </div>
</article>
<div class="nav-table">
    <div class="long-title"><span class="all-goods">全部分类</span></div>
    <jsp:include page="navigation.jsp"></jsp:include>
</div>
<b class="line"></b>
<div class="center">
    <div class="col-main">
        <div class="main-wrap">

            <div class="user-orderinfo">

                <!--标题 -->
                <div class="am-cf am-padding">
                    <div class="am-fl am-cf"><strong class="am-text-danger am-text-lg">订单详情</strong> / <small>Order&nbsp;details</small></div>
                </div>
                <hr/>
                <!--进度条-->
                <div class="m-progress">
                    <div class="m-progress-list">
                        <c:if test="${orders.orderstatus==0}">
								<span class="step-1 step">
                                   <em class="u-progress-stage-bg"></em>
                                   <i class="u-stage-icon-inner">1<em class="bg"></em></i>
                                   <p class="stage-name">拍下商品</p>
                                </span>
                        <span class="step-3 step">
                                   <em class="u-progress-stage-bg"></em>
                                   <i class="u-stage-icon-inner">2<em class="bg"></em></i>
                                   <p class="stage-name">卖家发货</p>
                                </span>
                        <span class="step-3 step">
                                   <em class="u-progress-stage-bg"></em>
                                   <i class="u-stage-icon-inner">3<em class="bg"></em></i>
                                   <p class="stage-name">确认收货</p>
                                </span>
                        <span class="step-3 step">
                                   <em class="u-progress-stage-bg"></em>
                                   <i class="u-stage-icon-inner">4<em class="bg"></em></i>
                                   <p class="stage-name">交易完成</p>
                                </span>
                        <span class="u-progress-placeholder"></span>
                        </c:if>
                        <c:if test="${orders.orderstatus==1}">
								<span class="step-2 step">
                                   <em class="u-progress-stage-bg"></em>
                                   <i class="u-stage-icon-inner">1<em class="bg"></em></i>
                                   <p class="stage-name">拍下商品</p>
                                </span>
                            <span class="step-3 step">
                                   <em class="u-progress-stage-bg"></em>
                                   <i class="u-stage-icon-inner">2<em class="bg"></em></i>
                                   <p class="stage-name">卖家发货</p>
                                </span>
                            <span class="step-3 step">
                                   <em class="u-progress-stage-bg"></em>
                                   <i class="u-stage-icon-inner">3<em class="bg"></em></i>
                                   <p class="stage-name">确认收货</p>
                                </span>
                            <span class="step-3 step">
                                   <em class="u-progress-stage-bg"></em>
                                   <i class="u-stage-icon-inner">4<em class="bg"></em></i>
                                   <p class="stage-name">交易完成</p>
                                </span>
                            <span class="u-progress-placeholder"></span>
                        </c:if>
                        <c:if test="${orders.orderstatus==2}">
								<span class="step-2 step">
                                   <em class="u-progress-stage-bg"></em>
                                   <i class="u-stage-icon-inner">1<em class="bg"></em></i>
                                   <p class="stage-name">拍下商品</p>
                                </span>
                            <span class="step-2 step">
                                   <em class="u-progress-stage-bg"></em>
                                   <i class="u-stage-icon-inner">2<em class="bg"></em></i>
                                   <p class="stage-name">卖家发货</p>
                                </span>
                            <span class="step-3 step">
                                   <em class="u-progress-stage-bg"></em>
                                   <i class="u-stage-icon-inner">3<em class="bg"></em></i>
                                   <p class="stage-name">确认收货</p>
                                </span>
                            <span class="step-3 step">
                                   <em class="u-progress-stage-bg"></em>
                                   <i class="u-stage-icon-inner">4<em class="bg"></em></i>
                                   <p class="stage-name">交易完成</p>
                                </span>
                            <span class="u-progress-placeholder"></span>
                        </c:if>
                        <c:if test="${orders.orderstatus==3}">
								<span class="step-2 step">
                                   <em class="u-progress-stage-bg"></em>
                                   <i class="u-stage-icon-inner">1<em class="bg"></em></i>
                                   <p class="stage-name">拍下商品</p>
                                </span>
                            <span class="step-2 step">
                                   <em class="u-progress-stage-bg"></em>
                                   <i class="u-stage-icon-inner">2<em class="bg"></em></i>
                                   <p class="stage-name">卖家发货</p>
                                </span>
                            <span class="step-2 step">
                                   <em class="u-progress-stage-bg"></em>
                                   <i class="u-stage-icon-inner">3<em class="bg"></em></i>
                                   <p class="stage-name">确认收货</p>
                                </span>
                            <span class="step-2 step">
                                   <em class="u-progress-stage-bg"></em>
                                   <i class="u-stage-icon-inner">4<em class="bg"></em></i>
                                   <p class="stage-name">交易完成</p>
                                </span>
                            <span class="u-progress-placeholder"></span>
                        </c:if>
                    </div>
                    <div class="u-progress-bar total-steps-2">
                        <div class="u-progress-bar-inner"></div>
                    </div>
                </div>
                <div class="order-infoaside">
                 <%-- <div class="order-logistics">
                        &lt;%&ndash;<a href="logistics.html">
                        <div class="icon-log">
                            <i><img src="${path}/images/receive.png"></i>
                        </div>
                        <div class="latest-logistics">
                            <p class="text">已签收,签收人是青年城签收，感谢使用天天快递，期待再次为您服务</p>
                            <div class="time-list">
                                <span class="date">2015-12-19</span><span class="week">周六</span><span class="time">15:35:42</span>
                            </div>
                            <div class="inquire">
                                <span class="package-detail">物流：天天快递</span>
                                <span class="package-detail">快递单号: </span>
                                <span class="package-number">373269427868</span>
                                <a href="logistics.html">查看</a>
                            </div>
                        </div>
                        <span class="am-icon-angle-right icon"></span>
                    </a>&ndash;%&gt;
                        <div class="clear"></div>
                    </div>--%>
                    <div class="order-addresslist">
                      <%--<div class="order-address">
                            <div class="icon-add">
                            </div>
                            <p class="new-tit new-p-re">
                                <span class="new-txt">小叮当</span>
                                <span class="new-txt-rd2">159****1622</span>
                            </p>
                            <div class="new-mu_l2a new-p-re">
                                <p class="new-mu_l2cw">
                                    <span class="title">收货地址：</span>
                                    <span class="province">湖北</span>省
                                    <span class="city">武汉</span>市
                                    <span class="dist">洪山</span>区
                                    <span class="street">雄楚大道666号(中南财经政法大学)</span></p>
                            </div>
                        </div>--%>
                    </div>
                </div>
                <div class="order-infomain">

                    <div class="order-top">
                        <div class="th th-item">
                            <td class="td-inner">商品</td>
                        </div>
                        <div class="th th-price">
                            <td class="td-inner">单价</td>
                        </div>
                        <div class="th th-number">
                            <td class="td-inner">数量</td>
                        </div>
                       <%-- <div class="th th-operation">
                            <td class="td-inner">商品操作</td>
                        </div>--%>
                        <div class="th th-amount">
                            <td class="td-inner">合计</td>
                        </div>
                        <div class="th th-status">
                            <td class="td-inner">交易状态</td>
                        </div>
                        <div class="th th-change">
                            <td class="td-inner">交易操作</td>
                        </div>
                    </div>

                    <div class="order-main">

                        <div class="order-status3">
                            <div class="order-title">
                                <div class="dd-num">订单编号：<a href="javascript:;">${orders.ordernum}</a></div>
                                <span>下单时间：${orderTime}</span>
                                <!--    <em>店铺：小桔灯</em>-->
                            </div>
                            <div class="order-content">
                                <div class="order-left">
                                    <c:forEach items="${orders.list}" var="list">
                                    <ul class="item-list">
                                        <li class="td td-item">
                                            <div class="item-pic">
                                                    <img src="${path}${list.pictureurl}" class="itempic J_ItemImg">
                                            </div>
                                            <div class="item-info">
                                                <div class="item-basic-info">
                                                        <p>${list.goodstitle} </p>
                                                </div>
                                            </div>
                                        </li>
                                        <li class="td td-price">
                                            <div class="item-price">
                                               ￥：${list.goodsprice}
                                            </div>
                                        </li>
                                        <li class="td td-number">
                                            <div class="item-number">
                                                <span>×</span>${list.goodsnum}
                                            </div>
                                        </li>
                                        <%--<li class="td td-operation">
                                            <div class="item-operation">
                                                退款/退货
                                            </div>
                                        </li>--%>
                                    </ul>
                                    </c:forEach>
                                </div>
                                <div class="order-right">
                                    <li class="td td-amount">
                                        <div class="item-amount">
                                            合计：￥:${orders.ordersalary}

                                        </div>
                                    </li>
                                    <div class="move-right">
                                        <c:if test="${orders.orderstatus==0}">
                                            <li class="td td-status">
                                                <div class="item-status">
                                                    <p class="Mystatus">未付款</p>
                                                    <p><a href="">订单详细</a></p>
                                                </div>
                                            </li>
                                            <li class="td td-change">
                                                <div class="am-btn am-btn-danger anniu">
                                                    一键支付
                                                </div>
                                            </li>
                                        </c:if>
                                        <c:if test="${orders.orderstatus==1}">
                                            <li class="td td-status">
                                                <div class="item-status">
                                                    <p class="Mystatus">待发货</p>
                                                </div>
                                            </li>
                                            <li class="td td-change">
                                                <a target="_blank"
                                                   href="http://wpa.qq.com/msgrd?v=3&uin=1403672737&site=qq&menu=yes">
                                                    <div class="am-btn am-btn-danger anniu">
                                                        提醒发货
                                                    </div>
                                                </a>
                                            </li>
                                        </c:if>
                                        <c:if test="${orders.orderstatus==2}">
                                            <li class="td td-status">
                                                <div class="item-status">
                                                    <p class="Mystatus">已发货</p>
                                                </div>
                                            </li>
                                            <li class="td td-change">
                                                <div class="am-btn am-btn-danger anniu"
                                                     onclick="confirm1(${orders.orderid})">
                                                    确认收货
                                                </div>
                                            </li>
                                        </c:if>
                                        <c:if test="${orders.orderstatus==3}">
                                            <li class="td td-status">
                                                <div class="item-status">
                                                    <p class="Mystatus">已完成</p>
                                                </div>
                                            </li>
                                            <li class="td td-change">
                                                <div class="am-btn am-btn-danger anniu" id="delete"
                                                     onclick="deleteorder(${orders.orderid})">
                                                    删除订单
                                                </div>
                                            </li>
                                        </c:if>
                                    </div>
                                </div>
                            </div>

                        </div>
                    </div>
                </div>
            </div>

        </div>
        <!--底部-->
        <div class="footer">

            <div class="footer-bd">
                <p>
                    <em>Copyright © 2006-2019 YONGHUI SUPERSTORES, All Rights Reserved小馋猫超市·版权所有  中国福建省厦门市软园24号  客服中心：86-591-83758880 4000601933</em>
                </p>
            </div>
        </div>

    </div>
    <jsp:include page="aside.jsp"></jsp:include>
</div>

<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script type="text/javascript">

    function confirm1(orderid) {
        layui.use(['laypage', 'layer'], function () {
            var laypage = layui.laypage, layer = layui.layer;
            //  $("#confirm").click(function () {
            $.ajax({
                url: "${path}/user.action/confirmOrders",
                type: "post",
                data: {
                    "orderid": orderid
                }, success: function (data) {
                    if (data.msg == "收货成功") {
                        layer.msg(data.msg, {icon: 1, time: 2000}, function () {
                            location.reload();
                        });
                    } else {
                        layer.msg(data.msg, {icon: 2, time: 2000}, function () {
                            location.reload();
                        });
                    }
                }
            });
        });
    }

    function deleteorder(orderid) {

        layui.use(['laypage', 'layer'], function () {
            var laypage = layui.laypage, layer = layui.layer;
            //  $("#confirm").click(function () {
            $.ajax({
                url: "${path}/user.action/deleteOrders",
                type: "post",
                data: {
                    "orderid": orderid
                }, success: function (data) {
                    if (data.msg == "删除成功") {
                        layer.msg(data.msg, {icon: 1, time: 2000}, function () {
                            location.href="${path}/user.action/toOrder";
                        });
                    } else {
                        layer.msg(data.msg, {icon: 2, time: 2000}, function () {
                            location.reload();
                        });
                    }
                }
            });
        });
    }

</script>
</body>

</html>
